unit fmxt_ModuleCheckConfigEdit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, fmBillModule, Menus, DB, StdActns, ActnList, ComCtrls, ToolWin,
  DBGridEhGrouping, ToolCtrlsEh, DBGridEhToolCtrls, DynVarsEh, GridsEh, ADODB,
  DBAxisGridsEh, DBGridEh, DBCtrlsEh, StdCtrls, Mask, DBCtrls, ExtCtrls;

type
  Tfrmxt_ModuleCheckConfigEdit = class(TfrmBillModule)
    Panel3: TPanel;
    Label18: TLabel;
    Label19: TLabel;
    Label21: TLabel;
    Label20: TLabel;
    DBEdit4: TDBEdit;
    DBEdit5: TDBEdit;
    DBEdit7: TDBEdit;
    DBEdit6: TDBEdit;
    plMaster: TPanel;
    Label1: TLabel;
    Label10: TLabel;
    Label3: TLabel;
    DBGridEh1: TDBGridEh;
    DBEditEh1: TDBEditEh;
    DBEditEh2: TDBEditEh;
    DBEditEh3: TDBEditEh;
    Label2: TLabel;
    Label4: TLabel;
    DBEdit1: TDBEdit;
    DBEdit2: TDBEdit;
    procedure DBEditEh2KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  protected
    {protected declarations}
    procedure FormInit; override;
    procedure DataModuleInit;override;
    procedure ShowDetailRecord; override;
  public
    { Public declarations }
  end;

var
  frmxt_ModuleCheckConfigEdit: Tfrmxt_ModuleCheckConfigEdit;

implementation

uses dmxt_ModuleCheckConfig, uMsgBox;

{$R *.dfm}

{ Tfrmxt_ModuleCheckConfigEdit }

procedure Tfrmxt_ModuleCheckConfigEdit.DataModuleInit;
begin
  inherited;
  FDataModuleClass := Tdtmxt_ModuleCheckConfig;
end;

procedure Tfrmxt_ModuleCheckConfigEdit.FormInit;
begin
  dsMaster.DataSet := Tdtmxt_ModuleCheckConfig(FDataModule).adsMasterEdit;
  dsDetail.DataSet := Tdtmxt_ModuleCheckConfig(FDataModule).adsDetail;
  inherited;

end;

procedure Tfrmxt_ModuleCheckConfigEdit.DBEditEh2KeyPress(Sender: TObject;
  var Key: Char);
begin
  inherited;
  Key := #0;
end;

procedure Tfrmxt_ModuleCheckConfigEdit.ShowDetailRecord;
begin
  //inherited;
  if Assigned(dsDetail.DataSet) and (dsMaster.DataSet.Active=True) then
  with TADODataSet(dsDetail.DataSet) do
  try
    DoBusy(True);
    Active := False;
    CommandText := 'select * from xt_ModuleCheckConfigDetail where ID='
      + QuotedStr(dsMaster.DataSet.FieldByName('ID').AsString)
      + ' order by OrderID';
    Active := True;
  finally
    DoBusy(False);
  end;
end;

end.
